{extend name='layout/base' /}
{block name='title'}导入用户数据{/block}
{block name='contentHeader'}
<h1>
    用户管理
    <small>导入用户数据</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 用户管理</a></li>
    <li class="active">导入用户数据</li>
</ol>
{/block}
{block name='content'}
<script src="__PLUGIN__/bootstrapvalidator/js/bootstrapValidator.min.js"></script>
<link rel="stylesheet" href="__PLUGIN__/bootstrapvalidator/css/bootstrapValidator.min.css">
<!-- Horizontal Form -->
<div class="box box-info" style="width:90%;margin: 0 auto;">
    <div class="box-header with-border">
        <h3 class="box-title">管理员参数</h3>
    </div>
    <!-- /.box-header -->
    <!-- form start -->
    <form id="form" class="form-horizontal" action="" method="post" enctype="multipart/form-data">
        <div class="box-body">
            <div class="form-group">
                <label for="excelTable" class="col-sm-2 control-label">
                    上传数据表格
                    <br/><a href="/uploads/template/UserTemp.xls" class="badge bg-green">下载数据样表</a>
                </label>
                <div class="col-sm-10">
                    <input id="excelTable" name="excelTable" type="file"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">管理员角色</label>
                <div class="col-sm-10">
                    {volist name='roles' id='role'}
                    <div class="radio">
                        <label>
                            <input type="radio" class="minimal" name="admin_role" value="{$key}">
                            {$role}
                        </label>
                    </div>
                    {/volist}
                </div>
            </div>
            <div id="loading"></div>
        </div>
        <!-- /.box-body -->
        <div class="box-footer">
            <button type="reset" class="btn btn-default">重置</button>
            <button type="submit" class="btn btn-info pull-right">提交</button>
        </div>
        <!-- /.box-footer -->
    </form>
</div>
<script type="text/javascript">
    //jQuery代码
    $(function () {
        $('form').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                excelTable: {
                    validators: {
                        notEmpty: {
                            message: '数据表不能为空'
                        }
                    }
                },
                admin_role: {
                    validators: {
                        notEmpty: {
                            message: '用户角色不能为空'
                        },
                        digits: {
                            message: '用户角色必须填数字'
                        }
                    }
                }
            }
        });
    });
</script>
{/block}